const dataFormat = (val) => {
  const date = new Date(val)
  const Y = date.getFullYear()
  const M = date.getMonth() + 1
  const S = date.getDate()
  return [Y, M, S].map(item => item >= 10 ? item : '0' + item).join('-')
}
wx.dataFormat = dataFormat